#!/usr/bin/python
# -*- coding: UTF-8 -*-


# *******************smtp 默认代理服务器相关配置***********************************
MAIL_HOST = "smtp.qq.com"
MAIL_USER = "675325758@qq.com"
MAIL_PASSWD = "zfaihmamcuagbcga"
MAIL_SUBJECT = "python mail"
MAIL_SENDER = "675325758@qq.com"

# MAIL_RECEIVER = ["535335139@qq.com", "675325758@qq.com"]
MAIL_RECEIVER = ["675325758@qq.com"]
MAIL_EXPIRE = 2 * 60


# ****************通用监控时间间隔*********************************************
COMMON_INTERVALTIME = 5


# *****************日志相关配置***********************************************************
LOG_REDIS_ONOFF = True
LOG_REDIS_HOST = "127.0.0.1"
LOG_REDIS_PORT = 6380
LOG_REDIS_APP = "Software2"
LOG_REDIS_MODEL = "monitor"

LOG_LEVEL_DEBUG = 3
LOG_LEVEL_INFO = 2
LOG_LEVEL_ERROR = 1
LOG_LEVEL = LOG_LEVEL_DEBUG

# 是否打印来源ip
LOG_IP_SOURCE = True
# 是否打印日志当前代码位置
LOG_CODE_POSITION = False

# ***********************限制报警***************************************************************
# **cpu限制报警**
ALARM_CPU_PERCENTAGE_LIMIT = 95
ALARM_CPU_EXCEPT_MAX_NUM = 3  # 连续出现n次后报警

# **mem限制报警**
ALARM_MEM_PERCENTAGE_LIMIT = 95  # 内存最多占用多少就报警
ALARM_MEM_EXCEPT_MAX_NUM = 3  # 内存限制出现多次后就发邮件

# **disk限制报警**
ALARM_DISK_PERCENTAGE_LIMIT = 95
ALARM_DISK_EXCEPT_MAX_NUM = 3

# **进程大小限制 m**
PROCESS_MEM_MAX_LIMIT = 100  # 一个进程超过100m报区

# **进程监控**
PROCESSES_MONITOR = {
    "wateraffairs_web": {
        "name": "/home/galaxywind/wechat_server/wechat_aysnc/wateraffairs_start.php",
        "number": 6,
    },
    "wateraffairs_server": {
        "name": "/home/galaxywind/wechat_server/wechat_aysnc/wateraffairs_service_start.php",
        "number": 4,
    },
    "watermeter_web": {
        "name": "/home/galaxywind/wechat_server/wechat_aysnc/watermeter_start.php",
        "number": 6,
    },
    "watermeter_server": {
        "name": "/home/galaxywind/wechat_server/wechat_aysnc/watermeter_service_start.php",
        "number": 4,
    },
}

PROCESSES_PID_FILES = {
    # "docker main": {"name": "docker", "pid_file": "/var/run/docker.pid"},
}
